package com.yjd.comm.merchant.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.merchant.model.MerchantModel;
import com.yjd.comm.user.dto.MerchantSession;

import java.util.Map;

/**
 * <b>description</b>：商户信息业务接口<br>
 * <b>time</b>：2017-08-11 17:29:51 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IMerchantService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MerchantModel insert(MerchantModel model) throws Exception;

	/**
	 * 开户
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MerchantModel openMerchant(MerchantModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(MerchantModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param org_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long org_id) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 *
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public int delete(Map paramMap) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 *
	 * @param merchant
	 * @return
	 * @throws Exception
	 */
	public int deleteMerchantAndFundsAccount(MerchantModel merchant) throws Exception;

	/**
	 * 商户登陆
	 *
	 * @param username
	 * @param password
	 * @return
	 * @throws Exception
	 */
	MerchantModel login(String username, String password, String loginIp) throws Exception;

	/**
	 * 商户APP登陆
	 *
	 * @param username
	 * @param password
	 * @return
	 * @throws Exception
	 */
	MerchantModel mobileLogin(String username, String password, Map<String, String> param) throws Exception;

	/**
	 * 商户APP退出
	 *
	 * @param org_id
	 * @return
	 * @throws Exception
	 */
	void mobileLogout(Long org_id, String device_no) throws Exception;

	/**
	 * 获取商户信息
	 * @param id
	 * @return UserSession
	 */
	public MerchantSession getMerchantSession(Long id);

	/**
	 * 获取商户APP登陆信息
	 * @param id
	 * @return UserSession
	 */
	public MerchantSession getMerchantMobileSession(Long id);
}
